# raise 抛出
print('抛出raise')
print('\n---> Can i go to school ? <---:\n')
e = Exception('Your age too small ! ')

def to_study(age):
    if age>=6:
        print('You can go to studying')
    else:
        raise e

to_study(7)

try:
    to_study(5)
except Exception as e:
    print(e)
finally:
    print('Go to studying after the age of six ')

# 征兵
print('\n---> 征兵: <---\n')
e = Exception('Your height is too short')

def zhengbing(height):
    if height>=150:
        print('You can go to zhengbing')
    else:
        raise e

zhengbing(150)

try:
    zhengbing(149)
except Exception as e:
    print(e)
finally:
    print('Your height need to be over 150')
